<template>
	<view style="padding-bottom: 20rpx;">
		<u-navbar title="店铺信息" :border-bottom='false' back-icon-size='48'></u-navbar>
		<u-gap height="20" bg-color="#F2F2F7"></u-gap>
		<view class="shopInfo">
			<view class="title">
				店铺信息
			</view>
			<view class="shopInfo-li">
				<view class="text">店铺名称</view>
				<input type="text" v-model="items.shop_name" placeholder="请输入店铺名称" />
			</view>
			<view class="shopInfo-li">
				<view class="text">店铺说明</view>
				<input type="text" v-model='items.content' placeholder="请输入店铺说明" />
				<u-icon style='margin-left: auto;' name="arrow-right" color="#999999" size="28"></u-icon>
			</view>
			<!-- 			<view class="title" style="font-size: 28rpx;font-weight: 400;">
				配置营业日期
			</view>
			<view class="daytime">
				<view class="dayItem">
					周一至周五
				</view>
				<view class="dayItem">
					周一至周五
				</view>
				<view class="dayItem">
					周一至周五
				</view>
				<view class="dayItem">
					周一至周五
				</view>
			</view>
			<view class="shopInfo-li">
				<view class="text">营业开始时间</view>
				<input type="text" placeholder="请选择时间" />
				<u-icon style='margin-left: auto;' name="arrow-right" color="#999999" size="28"></u-icon>
			</view>
			<view class="shopInfo-li">
				<view class="text">营业结束时间</view>
				<input type="text" placeholder="请选择时间" />
				<u-icon style='margin-left: auto;' name="arrow-right" color="#999999" size="28"></u-icon>
			</view> -->
		</view>
		<u-gap height="20" bg-color="#F2F2F7"></u-gap>
		<view class="shopInfo">
			<view class="shopInfo-li">
				<view class="text">选择经营类目</view>
				<input type="text" placeholder="请选择" disabled v-model="shopType" />
				<u-icon style='margin-left: auto;' name="arrow-right" color="#999999" size="28"
					@click="showPciker=true"></u-icon>
			</view>
			<view class="shopInfo-li">
				<view class="text">人均消费</view>
				<input type="number" v-model="items.average_cost" placeholder="请输入人均消费" />
			</view>
			<view class="shopInfo-li">
				<view class="text">所在地区</view>
				<input type="text" placeholder="请选择" v-model='items.province' disabled />
				<u-icon style='margin-left: auto;' name="arrow-right" color="#999999" size="28" @click="showCity=true">
				</u-icon>
			</view>
			<view class="shopInfo-li">
				<view class="text">详细地址</view>
				<input type="number" v-model="items.address" placeholder="请输入店铺地址" />
			</view>
			<view class="title" style="font-size: 28rpx;font-weight: 400;">
				设施与福利
			</view>
			<view class="checkBox">
<!--        <text v-for="(item, index) in items.tagsname" :key="index">{{ item }}</text>-->
				<u-checkbox-group @change="changeFn">
					<u-checkbox v-model="item.checked" v-for="(item, index) in items.tagsname" :key="index" :name="item">
						{{item}}
					</u-checkbox>
				</u-checkbox-group>
			</view>
		</view>
		<u-gap height="20" bg-color="#F2F2F7"></u-gap>
		<view class="imgBox">
			<view class="title">
				上传照片
			</view>
			<view class="coverBox">
				<view class="tip">
					店铺封面 <text>(推荐尺寸 340x258）</text>
				</view>
				<view class="addPic" v-if="shopIcon">
					<image style="width: 100%;height: 100%;" :src="'https://api.loveworldzh.com/'+shopIcon" mode="">
					</image>
				</view>
				<view class="addPic" @click="uploadShopIcon" v-else>
					<image src="../../../static/imgs/xiangji.png" mode=""></image>
				</view>
			</view>
			<view class="envBox">
				<view class="tip">
					环境照片 <text>(推荐尺寸 336x226）</text>
				</view>
				<view class="imgs">
					<view class="img-li" v-for="(img,index) in imgList" :key='index'>
						<image class="icon" :src="'https://api.loveworldzh.com/'+img" mode=""></image>
						<u-icon class='close' name="close-circle-fill" color="rgba(0, 0, 0, 0.32)" size="40"
							@click="del(index)"></u-icon>
					</view>
					<view class="addPic" @click="uploadShopIconMore">
						<image src="../../../static/imgs/xiangji.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
		<u-gap height="20" bg-color="#F2F2F7"></u-gap>
		<view class="idCard">
			<view class="title">
				上传身份照片
			</view>
			<view class="cardBox">
				<view>
					<view class="cardBox-zheng" @click="idCardz" v-if="!idImgz">
						拍摄正面
					</view>
					<image v-else style="width: 276rpx;height: 240rpx;margin-right: 80rpx;"
						:src="'https://api.loveworldzh.com/'+idImgz" mode=""></image>
				</view>
				<view>
					<view class="cardBox-fan" @click="idCardf" v-if="!idImgf">
						拍摄背面
					</view>
					<image v-else style="width: 276rpx;height: 240rpx;" :src="'https://api.loveworldzh.com/'+idImgf"
						mode=""></image>
				</view>
		
			</view>
		</view>
		<u-gap height="20" bg-color="#F2F2F7"></u-gap>
		<view class="license">
			<view class="title">
				营业执照
			</view>
			<view class="licenseBox">
				<view class="img-li" v-if="shopImg">
					<image class="icon" :src="'https://api.loveworldzh.com/'+shopImg" mode=""></image>
					<u-icon class='close' name="close-circle-fill" color="rgba(0, 0, 0, 0.32)" size="40"></u-icon>
				</view>
				<view class="add" @click="addImg">
					<image src="../../../static/imgs/xiangji.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import myRequest from '@/api/goods.js'
	export default {
		data() {
			return {
        items:{},
        id:0
			}
		},
		onLoad(options) {
		  this.id = options.id
		  this.getShopMsg()
		},
		methods: {
      async getShopMsg(){
        const id = this.id
        let res = await myRequest.getShopDetails({shop_id:id})
        if(res.status){
          this.items = res.data
        }
      }
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
<style lang="scss" scoped>
	.shopInfo {
		width: 100%;
		height: auto;
		background-color: #FFFFFF;
		padding: 0 20rpx;

		.title {
			width: 100%;
			height: 88rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 88rpx;
		}

		.shopInfo-li {
			width: 100%;
			height: 88rpx;
			display: flex;
			align-items: center;

			input {
				height: 88rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
			}

			.text {
				width: 30%;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
			}
		}

		.daytime {
			width: 100%;
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.dayItem {
				width: 168rpx;
				height: 56rpx;
				background: #F2F2F7;
				border-radius: 8rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #666666;
				text-align: center;
				line-height: 56rpx;
			}
		}

		.checkBox {
			width: 100%;
			height: 88rpx;
			display: flex;
			align-items: center;
		}

	}

	.imgBox {
		padding: 0 20rpx;
		width: 100%;
		height: auto;
		background-color: #FFFFFF;

		.title {
			width: 100%;
			height: 88rpx;
			line-height: 88rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}

		.coverBox {
			.tip {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;

				text {
					margin-left: 4rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #666666;
				}
			}

			.addPic {
				margin-top: 16rpx;
				width: 168rpx;
				height: 168rpx;
				background: #F2F2F7;
				border-radius: 8rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					width: 68rpx;
					height: 68rpx;
				}
			}
		}

		.envBox {
			margin-top: 32rpx;

			.tip {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;

				text {
					margin-left: 4rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #666666;
				}
			}

			.imgs {
				display: flex;
				align-items: center;
				flex-wrap: wrap;
				margin-top: 16rpx;

				.img-li {
					position: relative;
					width: 168rpx;
					height: 168rpx;
					margin-right: 10rpx;
					margin-bottom: 10rpx;

					&:nth-child(4n) {
						margin-right: 0rpx;
					}

					.close {
						position: absolute;
						top: 6rpx;
						right: 6rpx;
						z-index: 99;
					}

					.icon {
						position: absolute;
						width: 168rpx;
						height: 168rpx;
					}
				}

				.addPic {
					width: 168rpx;
					height: 168rpx;
					background: #F2F2F7;
					border-radius: 8rpx;
					display: flex;
					align-items: center;
					justify-content: center;

					image {
						width: 68rpx;
						height: 68rpx;
					}
				}
			}
		}
	}
	
	
	.idCard {
		width: 100%;
		height: auto;
		background-color: #FFFFFF;
		padding: 0 20rpx;
	
		.title {
			width: 100%;
			height: 88rpx;
			line-height: 88rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
	
		.cardBox {
			display: flex;
			align-items: center;
			justify-content: center;
			padding-bottom: 88rpx;
			margin-top: 20rpx;
	
			.cardBox-fan,
			.cardBox-zheng {
				width: 276rpx;
				height: 240rpx;
				text-align: center;
				padding-top: 194rpx;
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #FFFFFF;
			}
	
			.cardBox-zheng {
				margin-right: 80rpx;
				@include bgi('../../../static/imgs/shenfenzzm.png');
			}
	
			.cardBox-fan {
				@include bgi('../../../static/imgs/shenfenzfm.png');
			}
		}
	}
	
	.license {
		width: 100%;
		height: auto;
		background-color: #FFFFFF;
		padding: 0 20rpx;
	
		.title {
			width: 100%;
			height: 88rpx;
			line-height: 88rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
	
		.licenseBox {
			width: 100%;
			height: 232rpx;
			background: #FFFFFF;
			display: flex;
			align-items: center;
	
			.img-li {
				position: relative;
				width: 168rpx;
				height: 168rpx;
				margin-right: 10rpx;
				margin-bottom: 10rpx;
	
				&:nth-child(4n) {
					margin-right: 0rpx;
				}
	
				.close {
					position: absolute;
					top: 6rpx;
					right: 6rpx;
					z-index: 99;
				}
	
				.icon {
					position: absolute;
					width: 168rpx;
					height: 168rpx;
				}
			}
	
			.add {
				width: 168rpx;
				height: 168rpx;
				background: #F2F2F7;
				border-radius: 8rpx;
				display: flex;
				align-items: center;
				justify-content: center;
	
				image {
					width: 68rpx;
					height: 68rpx;
				}
			}
		}
	}
	
	.service {
		padding: 0 20rpx;
		width: 100%;
		height: 88rpx;
		background: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: space-between;
	
		.left {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
	
		.right {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #999999;
		}
	}

	.next {
		width: 670rpx;
		height: 100rpx;
		background: linear-gradient(180deg, #3FA3F9 0%, #2D7BF7 100%);
		border-radius: 16rpx;
		margin: 70rpx auto 0;
		line-height: 100rpx;
		text-align: center;
		font-size: 36rpx;
		font-family: PingFangSC-Medium;
		color: #FFFFFF;
	}
	
	.costPop {
		padding-bottom: 20rpx;
	
		.title {
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
	
		.cost-ul {
			padding: 0 20rpx;
	
			.cost-li {
				width: 100%;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
				border-bottom: 2rpx solid #F2F2F7;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
			}
		}
	}
</style>
